import apis from '../../http/apis.js'
export default{      
      async login(context,params){
          const {data} =await apis.users.login(params);
          const {data:userData,status,message,token} = data
          
          if (status) {
            const {username,isAdmins,_id} = userData[0];
            localStorage.loginUser = JSON.stringify({username,isAdmins,_id});
            localStorage.token = token;
            // this.$router.push("/System");
            location.hash = '#/System';
          } else {
            alert("用户名或密码错误");
          }
      }

}